package org.hyjiacan.util.jcapture;

import java.awt.AWTException;
import java.awt.Image;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;

import javax.swing.JFrame;

public class Tray {
	SystemTray tray;
	TrayIcon icon;

	public Tray(final JFrame win, String title, Image img, PopupMenu menu) throws AWTException {
		if (SystemTray.isSupported()) {
			tray = SystemTray.getSystemTray();			
			icon = new TrayIcon(img, title, menu);
			icon.setImageAutoSize(true);
			tray.add(icon);				
		}
	}
}
